// server/routes/familyMemberRoutes.js
const express = require('express');
const router = express.Router();
const familyMemberController = require('../controllers/familyMemberController');
const authMiddleware = require('../middlewares/authMiddleware');

// 所有路由需要认证
router.use(authMiddleware);

// 获取所有家庭成员
router.get('/', familyMemberController.getAllMembers);

// 获取单个家庭成员详情
router.get('/:id', familyMemberController.getMemberById);

// 创建家庭成员
router.post('/', familyMemberController.createMember);

// 更新家庭成员
router.put('/:id', familyMemberController.updateMember);

// 删除家庭成员
router.delete('/:id', familyMemberController.deleteMember);

module.exports = router; 